t
Runtime Interruption*120*

During execution, two conditions can arise that cause the Prograph interpreter to suspend execution, aside from encountering a Breakpoint or a method with Single Step on.

o
The first condition is a reference to a program element that does not exist. Rectifying such an omission requires little user interaction.

o
The second condition is an execution error. Fixing this requires more user interaction.

Automatic Creation at Runtime*120*

An extremely useful feature of the Prograph interpreter is the runtime creation of methods, classes, attributes, and persistents. If an attempt is made to execute an operation for which the associated element does not exist, a dialog is displayed asking whether the element should be created. If the user clicks the OK button on this dialog, the interpreter creates the element. If the user clicks the Cancel button, the interpreter closes the dialog but treats the condition as an error, opening the appropriate execution case window and signalling an error. 

Method*120*

When the element is a method, the displayed dialog informs the user about the type and name of method that Prograph is attempting to call. For example:*120*

*120*If the user presses the OK button, the interpreter creates a method and opens its first case window with correct arity. Depending on the name of the operation that initiated this interaction, the method created is either universal, or is created in an appropriate class. If the name completely specifies the class, the method is created there. If the operation is data-determined, another dialog opens with a scrolling list containing the class of the incoming instance (selected) and all its ancestor classes. The user then selects the class in which to create the new method.*121*

Attribute*121*

If an attempt is made to execute a Get or Set on an attribute that does not exist, the interpreter displays a dialog similar to the one shown above for methods. On clicking the OK button, another dialog opens for choosing whether the new attribute is to be a class attribute or an instance attribute, as follows. If the leftmost input to the operation initiating this interaction is a string, the dialog opens with the radio button Class selected; otherwise the button Instance is initially selected. *121*

When the user clicks the OK button, Prograph creates the new instance or class attribute and opens a Value window for the user to set the default or initial value of the attribute, respectively (see chapter 2, “The Editor Environment”). The attribute is added as the last attribute of its kind in the class.

Persistents *121*

If an attempt is made to execute a persistent operation referencing a persistent that does not exist, the interpreter displays a dialog similar to the one shown above for methods. If the user clicks the OK button, Prograph creates the persistent and opens a Value window for the user to set its initial value. *121* 

Classes *122*

If an attempt is made to execute an instance generator for a nonexistent class, the interpreter displays a dialog similar to that above for methods. If the user clicks the OK button, Prograph creates a new class not connected to any existing class.

Errors in Execution*122*

When an error occurs during execution, the interpreter suspends the execution, opens the appropriate execution case window, flashes the erroneous operation, beeps, and generates a message describing the error, which is automatically displayed if Error Messages has been checked in the Options… dialog (see chapter 2, “The Editor Environment”). If the Error Messages option is off, selecting Last Error… in the Info menu displays the error message. 

Typical errors during execution and their corresponding error dialogs are as follows:

o
arrival of values of inappropriate types on terminals. For example, a string arriving at a terminal of the primitive +

o
mismatch of arity (number of inputs or outputs) of an operation with that of the method it calls*122*

o
the activation of a Next Case control in the last case of a method*123*